TWB.New_Module({
	///////////////////////////
	name : "TWMMap",         //
	author : "enduo",        //
	version : 1.0,           //
	///////////////////////////

	Server : function(){
		switch(TWB.language){
			case "en": result="tribalwarsmap.com"; break;
			case "uk": result="tribalwarsmap.co.uk"; break;
			case "pl" : result="plemionamapa.pl"; break;
			case "de": result="diestaemmekarte.de"; break;
			case "nl": result="tribalwarsmap.com/nl"; break;
			case "se": result="tribalwarsmap.com/se"; break;
			case "br": result="tribalwarsmap.com/br"; break;
			case "pt": result="tribalwarsmap.com/pt"; break;
			case "cz": result="tribalwarsmap.com/cz"; break;
			case "ro": result="tribalwarsmap.com/ro"; break;
			case "gr": result="tribalwarsmap.com/gr"; break;
			case "no": result="tribalwarsmap.com/no"; break;
			case "sk": result="tribalwarsmap.com/sk"; break;
			case "hu": result="tribalwarsmap.com/hu"; break;
			case "dk": result="tribalwarsmap.com/dk"; break;
			case "es": result="tribalwarsmap.com/es"; break;
			case "ba": result="tribalwarsmap.com/ba"; break;
			case "si": result="tribalwarsmap.com/si"; break;
			case "hr": result="tribalwarsmap.com/hr"; break;
			default: result="tribalwarsmap.com"; break;
		}
		return result;
	},
	Show : function(){
		if(TWB.logged(window._content)){
			if(TWB.Modules.Icons.Screen()=="map"){
				var x,y;
				var DC=TWB._window();
				if(typeof DC.wrappedJSObject!="undefined"){
					DC=DC.wrappedJSObject;
				}
				[x,y]=DC.TWMap.pos;
				DC=TWB._window(TWB.Modules.TWMMap.Server());
				if(DC===null){
					var zo=TWB.World();
					srv="http://"+TWB.language+zo+"."+TWB.Modules.TWMMap.Server()+"/"+TWB.language+zo+"/?x="+x+"&y="+y;
					TWB.Load_Master_Url(srv);
				}
				else{
					if(typeof DC.wrappedJSObject!="undefined"){
						DC=DC.wrappedJSObject;
					}
					DC.mov(x,y);
				}
			}
			else{
				TWB.Processor.start("router","Modules.TWMMap.Show","*",true);
				TWB.Modules.Icons.GoTo("map");
			}
		}
	},
	North : function(){
		if(TWB.logged(window._content)){
			if(TWB.Modules.Icons.Screen()=="map"){
				var DC=TWB._window();
				if(typeof DC.wrappedJSObject!="undefined"){
					DC=DC.wrappedJSObject;
				}
				DC.TWMap.scrollBlock(0, -1);
			}
		}
	},
	South : function(){
		if(TWB.logged(window._content)){
			if(TWB.Modules.Icons.Screen()=="map"){
				var DC=TWB._window();
				if(typeof DC.wrappedJSObject!="undefined"){
					DC=DC.wrappedJSObject;
				}
				DC.TWMap.scrollBlock(0, 1);
			}
		}
	},
	West : function(){
		if(TWB.logged(window._content)){
			if(TWB.Modules.Icons.Screen()=="map"){
				var DC=TWB._window();
				if(typeof DC.wrappedJSObject!="undefined"){
					DC=DC.wrappedJSObject;
				}
				DC.TWMap.scrollBlock(-1, 0);
			}
		}
	},
	East : function(){
		if(TWB.logged(window._content)){
			if(TWB.Modules.Icons.Screen()=="map"){
				var DC=TWB._window();
				if(typeof DC.wrappedJSObject!="undefined"){
					DC=DC.wrappedJSObject;
				}
				DC.TWMap.scrollBlock(1, 0);
			}
		}
	}
});